package dao;

import models.Ability;
import utils.DBconn;

import java.sql.ResultSet;
import java.sql.SQLException;

public class AbilityDaoImpl implements AbilityDao {

    @Override
    public boolean setAbility(String cloumnName,String value) throws SQLException {
        boolean flag = false;
        if  (cloumnName != null && value !=null){

            DBconn.init();
            String sql = "update voicerobot.ability set "+cloumnName+"='"+ value+"';";
            // System.out.println(sql);
            int i = DBconn.exec(sql);
            if (i > 0){
                flag = true;
            }
            DBconn.closeConn();

        }
        return flag;
    }


}
